package com.example.administrator.smartdevice.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.example.administrator.smartdevice.R;
import com.example.administrator.smartdevice.base.BaseActivity;
import com.example.administrator.smartdevice.serial.SerialPortManager;
import com.example.administrator.smartdevice.utils.AgentSharedPreferences;
import com.hhc.netty.DeviceModel;
import com.hhc.netty.NettyClient;
import com.hhc.netty.NettyReplyStatusMsg;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivity2 extends BaseActivity {
    private static final String TAG = "hhc";
    @BindView(R.id.et1)
    protected EditText et1;
    @BindView(R.id.et2)
    protected EditText et2;
    @BindView(R.id.et3)
    protected EditText et3;
    @BindView(R.id.et4)
    protected EditText et4;
    @BindView(R.id.et5)
    protected EditText et5;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    protected void setContentView() {
        setContentView(R.layout.activity_main2);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void onFailure(int requestCode, Object object) {

    }

    @Override
    protected void onSuccess(int requestCode, Object object) {

    }

    //家电状态改变
    @OnClick(R.id.activity_main_bt_appliance_status_change)
    protected void onApplianceChange() {
        SerialPortManager.getInstance().sendData(et1.getText().toString(), et2.getText().toString()
                , et3.getText().toString()
                , et4.getText().toString()
                , et5.getText().toString()
        );
    }
}
